package com.lelouch.concurrency.example.immutable;

import com.google.common.collect.Maps;
import com.lelouch.concurrency.annotation.NotThreadSafe;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * 不可变类
 *
 * @author lcy
 * @create 2018-05-23 16:01
 */
@Slf4j
@NotThreadSafe
public class ImmutableExample1 {

    private static final Integer a=1;
    private static final String b="b";
    private static final Map<Integer,Integer> map = Maps.newHashMap();

    static{
        map.put(1,2);
        map.put(3,4);
    }

    public static void main(String[] args) {
        map.put(5,6);
        log.info("{}",map.get(5));
    }
}
